import React, { Component } from 'react';
import { connect } from 'dva';
import styles from './index.less';
import { Modal } from 'antd';

class FaultAlarm extends Component<any, any> {
  state = {
    alarmUrl: '',
  };

  componentDidMount() {
    this.props.dispatch({
      type: 'vehicleInfoQuery/getDataWithRes',
      payload: {
        url: '/common/bigdata/url',
        dictKey: 'alarmView',
      },
      callback: response => {
        if (response && response.statusCode === '0' && response.data) {
          this.setState({
            alarmUrl: `${response.data}`,
          });
        }
      },
    });
  }

  render() {
    return (
      <div className={styles.root}>
        <iframe
          src={this.state.alarmUrl}
          style={{ display: 'block', height: '100%' }}
          width="100%"
          frameBorder="0"
        />
      </div>
    );
  }
}
export default connect()(FaultAlarm);
